<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Large-Scale Structure</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Large-Scale Structure' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../intern.html">Inter Modules</a></li><li><a href="index.html">building</a></li><li><a href="index.html#1">Chapter 1: Architecture</a></li><li><b>Large-Scale Structure</b></li></ul></div>
<p class="purpose">To manage the main, connectors and architecture packages of an Inter tree, together with its major building blocks: modules and their submodules.</p>

<ul class="toc"><li><a href="1-ls.html#SP1">&#167;1. Structure data</a></li><li><a href="1-ls.html#SP4">&#167;4. main</a></li><li><a href="1-ls.html#SP6">&#167;6. connectors</a></li><li><a href="1-ls.html#SP7">&#167;7. architectural</a></li><li><a href="1-ls.html#SP12">&#167;12. Modules</a></li><li><a href="1-ls.html#SP14">&#167;14. Submodules</a></li><li><a href="1-ls.html#SP17">&#167;17. Pragmas</a></li><li><a href="1-ls.html#SP18">&#167;18. Origins</a></li><li><a href="1-ls.html#SP19">&#167;19. Package types</a></li><li><a href="1-ls.html#SP20">&#167;20. Outside the packages</a></li><li><a href="1-ls.html#SP21">&#167;21. Convenient types</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. Structure data.</b>See <a href="P-wtmd.html" class="internal">What This Module Does</a> for a description of the conventions set
by the functions below. Our task in this section is basically to make
<span class="extract"><span class="extract-syntax">/main</span></span>, <span class="extract"><span class="extract-syntax">/main/connectors</span></span> and <span class="extract"><span class="extract-syntax">/main/architecture</span></span>, together with
modules such as <span class="extract"><span class="extract-syntax">/main/BasicInformKit</span></span>, and their submodules, such as
<span class="extract"><span class="extract-syntax">/main/BasicInformKit/activities</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">site_structure_data</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">main_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">package_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">main_request</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">connectors_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">package_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">connectors_request</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">architecture_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">package_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">architecture_request</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">architecture_bookmark</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">pragmas_bookmark</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">package_types_bookmark</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">origins_bookmark</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">dictionary</span><span class="plain-syntax"> *</span><span class="identifier-syntax">modules_indexed_by_name</span><span class="plain-syntax">; </span><span class="comment-syntax"> of </span><span class="extract"><span class="extract-syntax">module_request</span></span>

<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">text_literal_s</span><span class="plain-syntax">;</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">site_structure_data</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>The structure site_structure_data is private to this section.</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">LargeScale::clear_site_data</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">LargeScale::clear_site_data</span></span>:<br/>Building Module - <a href="1-bm.html#SP4">&#167;4</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">building_site</span><span class="plain-syntax"> *</span><span class="identifier-syntax">B</span><span class="plain-syntax"> = &amp;(</span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">B</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">main_package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">B</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">main_request</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">B</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">connectors_package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">B</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">connectors_request</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">B</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">architecture_package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">B</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">architecture_request</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">B</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">architecture_bookmark</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::at_start_of_this_repository</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">B</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">pragmas_bookmark</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::at_start_of_this_repository</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">B</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">origins_bookmark</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::at_start_of_this_repository</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">B</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">package_types_bookmark</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::at_start_of_this_repository</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">B</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">modules_indexed_by_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Dictionaries::new</span><span class="plain-syntax">(32, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">B</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">text_literal_s</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>The three special packages <span class="extract"><span class="extract-syntax">main</span></span>, <span class="extract"><span class="extract-syntax">connectors</span></span> and <span class="extract"><span class="extract-syntax">architectural</span></span> will be
created as needed. But we do not set the <span class="extract"><span class="extract-syntax">main_package</span></span>, <span class="extract"><span class="extract-syntax">connectors_package</span></span>
or <span class="extract"><span class="extract-syntax">architecture_package</span></span> fields when they are created: instead we set these
fields whenever we detect that a package now exists with the relevant names.
This is so that the fields are correctly set even when an Inter tree is being
redd in from an external file, rather than only when created anew in memory.
</p>

<p class="commentary">It follows that <span class="extract"><span class="extract-syntax">main</span></span>, <span class="extract"><span class="extract-syntax">connectors</span></span> and <span class="extract"><span class="extract-syntax">architectural</span></span> are reserved package
names, which cannot be used anywhere else in the tree.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">LargeScale::note_package_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">N</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">N</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"main"</span><span class="plain-syntax">)) </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">main_package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pack</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">N</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"connectors"</span><span class="plain-syntax">)) </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">connectors_package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pack</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">N</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"architectural"</span><span class="plain-syntax">)) </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">architecture_package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">pack</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. main.</b>Here are functions to read <span class="extract"><span class="extract-syntax">main</span></span>, possibly creating if necessary:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::main_package_if_it_exists</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">LargeScale::main_package_if_it_exists</span></span>:<br/><a href="1-ls.html#SP5">&#167;5</a>, <a href="1-ls.html#SP11">&#167;11</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">main_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::main_package</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">main_package</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><a href="1-pck.html#SP13" class="function-link"><span class="function-syntax">Packaging::incarnate</span></a><span class="plain-syntax">(</span><a href="1-ls.html#SP4" class="function-link"><span class="function-syntax">LargeScale::main_request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">main_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">package_request</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::main_request</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">LargeScale::main_request</span></span>:<br/><a href="1-ls.html#SP6">&#167;6</a>, <a href="1-ls.html#SP7">&#167;7</a>, <a href="1-ls.html#SP13">&#167;13</a>, <a href="1-ls.html#SP20">&#167;20</a><br/>Produce - <a href="3-prd.html#SP12">&#167;12</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">main_request</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">main_request</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><a href="1-pck.html#SP2" class="function-link"><span class="function-syntax">Packaging::request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><a href="1-in.html#SP6" class="function-link"><span class="function-syntax">InterNames::explicitly_named</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"main"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">),</span>
<span class="plain-syntax">                </span><a href="1-ls.html#SP19" class="function-link"><span class="function-syntax">LargeScale::package_type</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_plain"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">main_request</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">inter_symbols_table</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::main_scope</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">LargeScale::main_scope</span></span>:<br/>Identifier Finders - <a href="2-if.html#SP5_2">&#167;5.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterPackage::scope</span><span class="plain-syntax">(</span><a href="1-ls.html#SP4" class="function-link"><span class="function-syntax">LargeScale::main_package_if_it_exists</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">));</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>This finds a symbol by searching every package in a tree. It is used only
to find a very few high-level resources defined at nearly the top of a tree; in
a typical Inform run it is called only about 30 times, always successfully.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::find_symbol_in_tree</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">main_package</span><span class="plain-syntax"> = </span><a href="1-ls.html#SP4" class="function-link"><span class="function-syntax">LargeScale::main_package_if_it_exists</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">main_package</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterPackage::find_symbol_slowly</span><span class="plain-syntax">(</span><span class="identifier-syntax">main_package</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. connectors.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::connectors_package_if_it_exists</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">connectors_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::ensure_connectors_package</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">connectors_package</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><a href="1-pck.html#SP13" class="function-link"><span class="function-syntax">Packaging::incarnate</span></a><span class="plain-syntax">(</span><a href="1-ls.html#SP6" class="function-link"><span class="function-syntax">LargeScale::connectors_request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">connectors_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">package_request</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::connectors_request</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">LargeScale::connectors_request</span></span>:<br/>Inter Namespace - <a href="1-in.html#SP6">&#167;6</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">connectors_request</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">connectors_request</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><a href="1-pck.html#SP2" class="function-link"><span class="function-syntax">Packaging::request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><a href="1-in.html#SP6" class="function-link"><span class="function-syntax">InterNames::explicitly_named</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"connectors"</span><span class="plain-syntax">, </span><a href="1-ls.html#SP4" class="function-link"><span class="function-syntax">LargeScale::main_request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">)),</span>
<span class="plain-syntax">                </span><a href="1-ls.html#SP19" class="function-link"><span class="function-syntax">LargeScale::package_type</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_linkage"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">connectors_request</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">inter_symbols_table</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::connectors_scope</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">LargeScale::connectors_scope</span></span>:<br/>Identifier Finders - <a href="2-if.html#SP5_2">&#167;5.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterPackage::scope</span><span class="plain-syntax">(</span><a href="1-ls.html#SP6" class="function-link"><span class="function-syntax">LargeScale::connectors_package_if_it_exists</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">));</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. architectural.</b>This is the only one of the big three which we put any material into in this
section of code; so we need a bookmark for where that material goes.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::architecture_package_if_it_exists</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">LargeScale::architecture_package_if_it_exists</span></span>:<br/><a href="1-ls.html#SP11">&#167;11</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">architecture_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::architecture_package</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">LargeScale::architecture_package</span></span>:<br/><a href="1-ls.html#SP8">&#167;8</a>, <a href="1-ls.html#SP10">&#167;10</a><br/>Emitting Inter Schemas - <a href="2-eis.html#SP2_1_3">&#167;2.1.3</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">architecture_package</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><a href="1-pck.html#SP13" class="function-link"><span class="function-syntax">Packaging::incarnate</span></a><span class="plain-syntax">(</span><a href="1-ls.html#SP7" class="function-link"><span class="function-syntax">LargeScale::architecture_request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">architecture_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">package_request</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::architecture_request</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">LargeScale::architecture_request</span></span>:<br/>Location Requirements - <a href="1-lr.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">architecture_request</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">architecture_request</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><a href="1-pck.html#SP2" class="function-link"><span class="function-syntax">Packaging::request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><a href="1-in.html#SP6" class="function-link"><span class="function-syntax">InterNames::explicitly_named</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"architectural"</span><span class="plain-syntax">, </span><a href="1-ls.html#SP4" class="function-link"><span class="function-syntax">LargeScale::main_request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">)),</span>
<span class="plain-syntax">                </span><a href="1-ls.html#SP19" class="function-link"><span class="function-syntax">LargeScale::package_type</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_linkage"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">packaging_state</span><span class="plain-syntax"> </span><span class="identifier-syntax">save</span><span class="plain-syntax"> = </span><a href="1-pck.html#SP12" class="function-link"><span class="function-syntax">Packaging::enter</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">architecture_request</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">architecture_bookmark</span><span class="plain-syntax"> = </span><a href="1-pck.html#SP9" class="function-link"><span class="function-syntax">Packaging::bubble</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-pck.html#SP12" class="function-link"><span class="function-syntax">Packaging::exit</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">save</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">architecture_request</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. </b>There are two sorts of constant in <span class="extract"><span class="extract-syntax">architectural</span></span>. One set is created only
on demand: if you look for <span class="extract"><span class="extract-syntax">#grammar_table</span></span> you will find it, but if you never
look then it will never exist. These are used only for a handful of values
which are redefined by the <a href="../final-module/index.html" class="internal">final</a> code-generator anyway: here we define
them as 0 &mdash; meaninglessly, but they have to be set to something. They are
not, in fact, all constants &mdash; <span class="extract"><span class="extract-syntax">self</span></span> is a variable at runtime &mdash; but again,
it's for the code-generator to define them as it would like, on a platform
by platform basis.
</p>

<p class="commentary">For speed, the names of the permitted veneer symbols are stored in a dictionary.
(This may not in fact be worth the overhead any longer: at one time there were
many more of these.)
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">dictionary</span><span class="plain-syntax"> *</span><span class="identifier-syntax">create_these_architectural_symbols_on_demand</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>

<span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::find_architectural_symbol</span><button class="popup" onclick="togglePopup('usagePopup10')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup10">Usage of <span class="code-font"><span class="function-syntax">LargeScale::find_architectural_symbol</span></span>:<br/>Identifier Finders - <a href="2-if.html#SP5_2">&#167;5.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">N</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arch</span><span class="plain-syntax"> = </span><a href="1-ls.html#SP7" class="function-link"><span class="function-syntax">LargeScale::architecture_package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbols_table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tab</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">arch</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterSymbolsTable::symbol_from_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">tab</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">S</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="1-ls.html#SP8_1" class="named-paragraph-link"><span class="named-paragraph">Ensure the on-demand dictionary exists</span><span class="named-paragraph-number">8.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Dictionaries::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_these_architectural_symbols_on_demand</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_dec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">, </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">(), </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">S</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">LargeScale::is_veneer_symbol</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">con_name</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">con_name</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">home</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterSymbol::package</span><span class="plain-syntax">(</span><span class="identifier-syntax">con_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::tree</span><span class="plain-syntax">(</span><span class="identifier-syntax">home</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">home</span><span class="plain-syntax"> == </span><a href="1-ls.html#SP7" class="function-link"><span class="function-syntax">LargeScale::architecture_package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">N</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterSymbol::identifier</span><span class="plain-syntax">(</span><span class="identifier-syntax">con_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Dictionaries::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_these_architectural_symbols_on_demand</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">))</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8_1" class="paragraph-anchor"></a><b>&#167;8.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Ensure the on-demand dictionary exists</span><span class="named-paragraph-number">8.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">create_these_architectural_symbols_on_demand</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">create_these_architectural_symbols_on_demand</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Dictionaries::new</span><span class="plain-syntax">(16, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Dictionaries::create</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_these_architectural_symbols_on_demand</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"#dictionary_table"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Dictionaries::create</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_these_architectural_symbols_on_demand</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"#actions_table"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Dictionaries::create</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_these_architectural_symbols_on_demand</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"#grammar_table"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Dictionaries::create</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_these_architectural_symbols_on_demand</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"self"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Dictionaries::create</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_these_architectural_symbols_on_demand</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Routine"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Dictionaries::create</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_these_architectural_symbols_on_demand</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"String"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Dictionaries::create</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_these_architectural_symbols_on_demand</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Class"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">Dictionaries::create</span><span class="plain-syntax">(</span><span class="identifier-syntax">create_these_architectural_symbols_on_demand</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Object"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="1-ls.html#SP8">&#167;8</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. </b>The other architectural constants are the ones depending on the architecture
being compiled to. These always exist, and their values are known at compile time.
</p>

<p class="commentary">They mostly have obvious meanings, but a few notes:
</p>

<ul class="items"><li>(1) <span class="extract"><span class="extract-syntax">WORDSIZE</span></span> is the number of bytes in a word.
</li><li>(2) <span class="extract"><span class="extract-syntax">NULL</span></span>, in our runtime, is -1, and not 0 as it would be in C.
</li><li>(3) <span class="extract"><span class="extract-syntax">IMPROBABLE_VALUE</span></span> is one which is unlikely even if possible to be a
genuine I7 value. The efficiency of runtime code handling tables depends on
how well chosen this is: it would ran badly if we chose 1, for instance.
</li><li>(4) Exactly one of the symbols <span class="extract"><span class="extract-syntax">TARGET_ZCODE</span></span> or <span class="extract"><span class="extract-syntax">TARGET_GLULX</span></span> is defined,
and given the notional value 1, though its only purpose is to enable conditional
compilation to work (see <a href="../pipeline-module/3-rccs.html" class="internal">Resolve Conditional Compilation Stage (in pipeline)</a>);
so its importance is whether or not it is defined, not what value it has. Note
that these names are now a little anachronistic, and they should perhaps be
renamed <span class="extract"><span class="extract-syntax">TARGET_16BIT</span></span> and <span class="extract"><span class="extract-syntax">TARGET_32BIT</span></span> respectively. For example, C code
can happily be generated from an Inter tree containing <span class="extract"><span class="extract-syntax">TARGET_GLULX</span></span>, even
though that code will never produce a program running on the Glulx VM.
</li><li>(5) And similarly for <span class="extract"><span class="extract-syntax">DEBUG</span></span>, which again exists to enable conditional
compilation when building kits.
</li></ul>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">LargeScale::make_architectural_definitions</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_architecture</span><span class="plain-syntax"> *</span><span class="identifier-syntax">current_architecture</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">current_architecture</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"no architecture set"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_type</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Architectures::is_16_bit</span><span class="plain-syntax">(</span><span class="identifier-syntax">current_architecture</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_dec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"CHARSIZE"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,                      </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_dec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"WORDSIZE"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,                      </span><span class="constant-syntax">2</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_hex</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"NULL"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,                     </span><span class="constant-syntax">0xffff</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_hex</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"WORD_HIGHBIT"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,             </span><span class="constant-syntax">0x8000</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_hex</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"WORD_NEXTTOHIGHBIT"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,       </span><span class="constant-syntax">0x4000</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_hex</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"IMPROBABLE_VALUE"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,         </span><span class="constant-syntax">0x7fe3</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_dec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"MAX_POSITIVE_NUMBER"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,       </span><span class="constant-syntax">32767</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_signed</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"MIN_NEGATIVE_NUMBER"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,      -32768);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_dec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"TARGET_ZCODE"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,                  </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_dec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"CHARSIZE"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,                      </span><span class="constant-syntax">4</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_dec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"WORDSIZE"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,                      </span><span class="constant-syntax">4</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_hex</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"NULL"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,                 </span><span class="constant-syntax">0xffffffff</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_hex</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"WORD_HIGHBIT"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,         </span><span class="constant-syntax">0x80000000</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_hex</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"WORD_NEXTTOHIGHBIT"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,   </span><span class="constant-syntax">0x40000000</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_hex</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"IMPROBABLE_VALUE"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,     </span><span class="constant-syntax">0xdeadce11</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_dec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"MAX_POSITIVE_NUMBER"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,  </span><span class="constant-syntax">2147483647</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_signed</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"MIN_NEGATIVE_NUMBER"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">, -2147483648);</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_dec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,    </span><span class="identifier-syntax">I</span><span class="string-syntax">"TARGET_GLULX"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,                  </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Architectures::debug_enabled</span><span class="plain-syntax">(</span><span class="identifier-syntax">current_architecture</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant_dec</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"DEBUG"</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. </b>The functions above use the following tiny API to create architectural constants:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::arch_constant</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">N</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_type</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_pair</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arch</span><span class="plain-syntax"> = </span><a href="1-ls.html#SP7" class="function-link"><span class="function-syntax">LargeScale::architecture_package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbols_table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tab</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">arch</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterSymbolsTable::symbol_from_name_creating</span><span class="plain-syntax">(</span><span class="identifier-syntax">tab</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax"> = &amp;(</span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">architecture_bookmark</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-prd.html#SP17" class="function-link"><span class="function-syntax">Produce::guard</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ConstantInstruction::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">, </span><span class="identifier-syntax">val</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">S</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::arch_constant_dec</span><button class="popup" onclick="togglePopup('usagePopup11')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup11">Usage of <span class="code-font"><span class="function-syntax">LargeScale::arch_constant_dec</span></span>:<br/><a href="1-ls.html#SP8">&#167;8</a>, <a href="1-ls.html#SP9">&#167;9</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">N</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_type</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterValuePairs::number_in_base</span><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">, </span><span class="constant-syntax">10</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">S</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::arch_constant_hex</span><button class="popup" onclick="togglePopup('usagePopup12')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup12">Usage of <span class="code-font"><span class="function-syntax">LargeScale::arch_constant_hex</span></span>:<br/><a href="1-ls.html#SP9">&#167;9</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">N</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_type</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterValuePairs::number_in_base</span><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">, </span><span class="constant-syntax">16</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">S</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::arch_constant_signed</span><button class="popup" onclick="togglePopup('usagePopup13')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup13">Usage of <span class="code-font"><span class="function-syntax">LargeScale::arch_constant_signed</span></span>:<br/><a href="1-ls.html#SP9">&#167;9</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">N</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_type</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><a href="1-ls.html#SP10" class="function-link"><span class="function-syntax">LargeScale::arch_constant</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">N</span><span class="plain-syntax">, </span><span class="identifier-syntax">type</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">InterValuePairs::signed_number</span><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">S</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. </b>This falls back on the main package, but really, should be used only for
things which ought to be in <span class="extract"><span class="extract-syntax">architectural</span></span>:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::architectural_symbol</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">name</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">symbol</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax"> = </span><a href="1-ls.html#SP7" class="function-link"><span class="function-syntax">LargeScale::architecture_package_if_it_exists</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">P</span><span class="plain-syntax">) </span><span class="identifier-syntax">symbol</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterSymbolsTable::symbol_from_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterPackage::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">), </span><span class="identifier-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">symbol</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">symbol</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">P</span><span class="plain-syntax"> = </span><a href="1-ls.html#SP4" class="function-link"><span class="function-syntax">LargeScale::main_package_if_it_exists</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">P</span><span class="plain-syntax">) </span><span class="identifier-syntax">symbol</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterSymbolsTable::symbol_from_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterPackage::scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">), </span><span class="identifier-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">symbol</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. Modules.</b>Modules are identified by name, and each one produces an instance of the
following.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">module_request</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">package_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">where_found</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">submodules</span><span class="plain-syntax">; </span><span class="comment-syntax"> of </span><span class="extract"><span class="extract-syntax">submodule_request</span></span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">module_request</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>The structure module_request is private to this section.</li></ul>
<p class="commentary firstcommentary"><a id="SP13" class="paragraph-anchor"></a><b>&#167;13. </b>The tree's module dictionary is used to ensure that repeated calls with the
same module name return the same <span class="extract"><span class="extract-syntax">module_request</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">module_request</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::module_request</span><button class="popup" onclick="togglePopup('usagePopup14')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup14">Usage of <span class="code-font"><span class="function-syntax">LargeScale::module_request</span></span>:<br/><a href="1-ls.html#SP15">&#167;15</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">name</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">dictionary</span><span class="plain-syntax"> *</span><span class="identifier-syntax">D</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">modules_indexed_by_name</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Dictionaries::find</span><span class="plain-syntax">(</span><span class="identifier-syntax">D</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> (</span><span class="reserved-syntax">module_request</span><span class="plain-syntax"> *) </span><span class="identifier-syntax">Dictionaries::read_value</span><span class="plain-syntax">(</span><span class="identifier-syntax">D</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">module_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">new_module</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">module_request</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">new_module</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">where_found</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">        </span><a href="1-pck.html#SP2" class="function-link"><span class="function-syntax">Packaging::request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="1-in.html#SP6" class="function-link"><span class="function-syntax">InterNames::explicitly_named</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">name</span><span class="plain-syntax">, </span><a href="1-ls.html#SP4" class="function-link"><span class="function-syntax">LargeScale::main_request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">)),</span>
<span class="plain-syntax">            </span><a href="1-ls.html#SP19" class="function-link"><span class="function-syntax">LargeScale::package_type</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_module"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">new_module</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">submodules</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NEW_LINKED_LIST</span><span class="plain-syntax">(</span><span class="reserved-syntax">submodule_request</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Dictionaries::create</span><span class="plain-syntax">(</span><span class="identifier-syntax">D</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">Dictionaries::write_value</span><span class="plain-syntax">(</span><span class="identifier-syntax">D</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">, (</span><span class="reserved-syntax">void</span><span class="plain-syntax"> *) </span><span class="identifier-syntax">new_module</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">new_module</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP14" class="paragraph-anchor"></a><b>&#167;14. Submodules.</b>The idea here is that each module could define, say, some variables, placing
them in a submodule for that purpose. As a result, there will be a "variables only"
submodule found in several modules. Such flavours of submodule are preset &mdash;
we allow only a few of these: see <a href="../runtime-module/2-hrr.html" class="internal">Hierarchy (in runtime)</a> for the set used by
<a href="../inform7/index.html" class="internal">inform7</a> &mdash; and they must be specified in advance of use, with the following.
</p>

<p class="commentary">For the moment, at least, <span class="extract"><span class="extract-syntax">submodule_identity</span></span> is really just a textual name
like <span class="extract"><span class="extract-syntax">variables</span></span> but in a fancy wrapper.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">submodule_identity</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">submodule_name</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">submodule_identity</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">submodule_identity</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::register_submodule_identity</span><span class="plain-syntax">(</span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">name</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">submodule_identity</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sid</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">sid</span><span class="plain-syntax">, </span><span class="reserved-syntax">submodule_identity</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">sid</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">submodule_name</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">sid</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">sid</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">submodule_identity</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">sid</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">submodule_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">sid</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<ul class="endnotetexts"><li>The structure submodule_identity is private to this section.</li></ul>
<p class="commentary firstcommentary"><a id="SP15" class="paragraph-anchor"></a><b>&#167;15. </b>Armed with such an identity, the following can be called to return the relevant
submodule of a given module, creating it if it does not already exist.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">package_request</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::generic_submodule</span><button class="popup" onclick="togglePopup('usagePopup15')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup15">Usage of <span class="code-font"><span class="function-syntax">LargeScale::generic_submodule</span></span>:<br/>Hierarchy Locations - <a href="1-hl.html#SP19">&#167;19</a><br/>Location Requirements - <a href="1-lr.html#SP8">&#167;8</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="reserved-syntax">submodule_identity</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sid</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="1-ls.html#SP16" class="function-link"><span class="function-syntax">LargeScale::request_submodule_of</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><a href="1-ls.html#SP13" class="function-link"><span class="function-syntax">LargeScale::module_request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"generic"</span><span class="plain-syntax">), </span><span class="identifier-syntax">sid</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">package_request</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::synoptic_submodule</span><button class="popup" onclick="togglePopup('usagePopup16')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup16">Usage of <span class="code-font"><span class="function-syntax">LargeScale::synoptic_submodule</span></span>:<br/>Location Requirements - <a href="1-lr.html#SP9">&#167;9</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="reserved-syntax">submodule_identity</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sid</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="1-ls.html#SP16" class="function-link"><span class="function-syntax">LargeScale::request_submodule_of</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><a href="1-ls.html#SP13" class="function-link"><span class="function-syntax">LargeScale::module_request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"synoptic"</span><span class="plain-syntax">), </span><span class="identifier-syntax">sid</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">package_request</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::completion_submodule</span><button class="popup" onclick="togglePopup('usagePopup17')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup17">Usage of <span class="code-font"><span class="function-syntax">LargeScale::completion_submodule</span></span>:<br/>Location Requirements - <a href="1-lr.html#SP10">&#167;10</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="reserved-syntax">submodule_identity</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sid</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="1-ls.html#SP16" class="function-link"><span class="function-syntax">LargeScale::request_submodule_of</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><a href="1-ls.html#SP13" class="function-link"><span class="function-syntax">LargeScale::module_request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"completion"</span><span class="plain-syntax">), </span><span class="identifier-syntax">sid</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP16" class="paragraph-anchor"></a><b>&#167;16. </b>Those in turn all make use of this back-end function:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">submodule_request</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">package_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">where_found</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">submodule_identity</span><span class="plain-syntax"> *</span><span class="identifier-syntax">which_submodule</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">submodule_request</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">package_request</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::request_submodule_of</span><button class="popup" onclick="togglePopup('usagePopup18')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup18">Usage of <span class="code-font"><span class="function-syntax">LargeScale::request_submodule_of</span></span>:<br/><a href="1-ls.html#SP15">&#167;15</a><br/>Hierarchy Locations - <a href="1-hl.html#SP19">&#167;19</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="reserved-syntax">module_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">M</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">submodule_identity</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sid</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">submodule_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">sr</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">sr</span><span class="plain-syntax">, </span><span class="reserved-syntax">submodule_request</span><span class="plain-syntax">, </span><span class="identifier-syntax">M</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">submodules</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">sid</span><span class="plain-syntax"> == </span><span class="identifier-syntax">sr</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">which_submodule</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">sr</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">where_found</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">iname</span><span class="plain-syntax"> = </span><a href="1-in.html#SP6" class="function-link"><span class="function-syntax">InterNames::explicitly_named</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">sid</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">submodule_name</span><span class="plain-syntax">, </span><span class="identifier-syntax">M</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">where_found</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">sr</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">submodule_request</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">sr</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">which_submodule</span><span class="plain-syntax"> = </span><span class="identifier-syntax">sid</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">sr</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">where_found</span><span class="plain-syntax"> = </span><a href="1-pck.html#SP2" class="function-link"><span class="function-syntax">Packaging::request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">iname</span><span class="plain-syntax">, </span><a href="1-ls.html#SP19" class="function-link"><span class="function-syntax">LargeScale::package_type</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_submodule"</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">ADD_TO_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">sr</span><span class="plain-syntax">, </span><span class="reserved-syntax">submodule_request</span><span class="plain-syntax">, </span><span class="identifier-syntax">M</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">submodules</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">sr</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">where_found</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<ul class="endnotetexts"><li>The structure submodule_request is private to this section.</li></ul>
<p class="commentary firstcommentary"><a id="SP17" class="paragraph-anchor"></a><b>&#167;17. Pragmas.</b>There's very little to say here:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">LargeScale::emit_pragma</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">target</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">content</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="3-prd.html#SP17" class="function-link"><span class="function-syntax">Produce::guard</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">PragmaInstruction::new</span><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">pragmas_bookmark</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">target</span><span class="plain-syntax">, </span><span class="identifier-syntax">content</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP18" class="paragraph-anchor"></a><b>&#167;18. Origins.</b>Or here:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">LargeScale::emit_origin</span><button class="popup" onclick="togglePopup('usagePopup19')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup19">Usage of <span class="code-font"><span class="function-syntax">LargeScale::emit_origin</span></span>:<br/>Origins - <a href="1-org.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">origin</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">fn</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="3-prd.html#SP17" class="function-link"><span class="function-syntax">Produce::guard</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OriginInstruction::new</span><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">origins_bookmark</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">origin</span><span class="plain-syntax">, </span><span class="identifier-syntax">fn</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP19" class="paragraph-anchor"></a><b>&#167;19. Package types.</b>Or indeed here. Package types are created on request; looking for <span class="extract"><span class="extract-syntax">_octopus</span></span>
would create it if it didn't already exist. So although the Inform tools do
use a conventional set of package types, they are not itemised here.
</p>

<p class="commentary">However, note the lines relating to enclosure. An "enclosing" package is
one where the compiler keeps all resources needed by the contents of the
package, within that package. For example, if a function in an enclosing
package refers to a literal piece of text, then the necessary Inter array
holding that text must also be somewhere in the package.
</p>

<p class="commentary">It seems tidy to make all packages enclosing, and in fact (after much
experiment) Inform nearly does that. But <span class="extract"><span class="extract-syntax">_code</span></span> packages have to be an
exception, because the Inter specification doesn't allow constants (and
therefore arrays) to be defined inside <span class="extract"><span class="extract-syntax">_code</span></span> packages. This is where that
exception is made.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="function-syntax">LargeScale::package_type</span><button class="popup" onclick="togglePopup('usagePopup20')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup20">Usage of <span class="code-font"><span class="function-syntax">LargeScale::package_type</span></span>:<br/><a href="1-ls.html#SP4">&#167;4</a>, <a href="1-ls.html#SP6">&#167;6</a>, <a href="1-ls.html#SP7">&#167;7</a>, <a href="1-ls.html#SP13">&#167;13</a>, <a href="1-ls.html#SP16">&#167;16</a>, <a href="1-ls.html#SP20">&#167;20</a><br/>Hierarchy Locations - <a href="1-hl.html#SP15_1">&#167;15.1</a>, <a href="1-hl.html#SP16">&#167;16</a>, <a href="1-hl.html#SP19">&#167;19</a><br/>Packaging - <a href="1-pck.html#SP14">&#167;14</a>, <a href="1-pck.html#SP15">&#167;15</a><br/>Produce - <a href="3-prd.html#SP12">&#167;12</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">name</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbols_table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">scope</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterTree::global_scope</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterSymbolsTable::symbol_from_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterSymbolsTable::create_with_unique_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">scope</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="3-prd.html#SP17" class="function-link"><span class="function-syntax">Produce::guard</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">PackageTypeInstruction::new</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            &amp;(</span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">package_types_bookmark</span><span class="plain-syntax">), </span><span class="identifier-syntax">ptype</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">ptype</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">LargeScale::package_type_enclosing</span><button class="popup" onclick="togglePopup('usagePopup21')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup21">Usage of <span class="code-font"><span class="function-syntax">LargeScale::package_type_enclosing</span></span>:<br/>Hierarchy Locations - <a href="1-hl.html#SP15_1">&#167;15.1</a>, <a href="1-hl.html#SP16">&#167;16</a><br/>Packaging - <a href="1-pck.html#SP8">&#167;8</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ptype</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ptype</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">InterSymbol::identifier</span><span class="plain-syntax">(</span><span class="identifier-syntax">ptype</span><span class="plain-syntax">), </span><span class="identifier-syntax">I</span><span class="string-syntax">"_code"</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP20" class="paragraph-anchor"></a><b>&#167;20. Outside the packages.</b>The Inter specification calls for just a handful of resources to be placed
at the top level, outside even the <span class="extract"><span class="extract-syntax">main</span></span> package. Using bubbles, we leave
room to insert those resources, then incarnate <span class="extract"><span class="extract-syntax">main</span></span> and enter it.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">LargeScale::begin_new_tree</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="1-pck.html#SP7" class="function-link"><span class="function-syntax">Packaging::initialise_state</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><a href="3-prd.html#SP19" class="function-link"><span class="function-syntax">Produce::comment</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Package types:"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">package_types_bookmark</span><span class="plain-syntax"> = </span><a href="1-pck.html#SP9" class="function-link"><span class="function-syntax">Packaging::bubble</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><a href="3-prd.html#SP19" class="function-link"><span class="function-syntax">Produce::comment</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Origins:"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">origins_bookmark</span><span class="plain-syntax"> = </span><a href="1-pck.html#SP9" class="function-link"><span class="function-syntax">Packaging::bubble</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><a href="3-prd.html#SP19" class="function-link"><span class="function-syntax">Produce::comment</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Pragmas:"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">pragmas_bookmark</span><span class="plain-syntax"> = </span><a href="1-pck.html#SP9" class="function-link"><span class="function-syntax">Packaging::bubble</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><a href="3-prd.html#SP19" class="function-link"><span class="function-syntax">Produce::comment</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Primitives:"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="1-ip.html#SP14" class="function-link"><span class="function-syntax">Primitives::declare_standard_set</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><a href="1-pck.html#SP7" class="function-link"><span class="function-syntax">Packaging::at</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">));</span>

<span class="plain-syntax">    </span><a href="1-ls.html#SP19" class="function-link"><span class="function-syntax">LargeScale::package_type</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_plain"</span><span class="plain-syntax">);   </span><span class="comment-syntax"> To ensure this is the first emitted ptype</span>
<span class="plain-syntax">    </span><a href="1-ls.html#SP19" class="function-link"><span class="function-syntax">LargeScale::package_type</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_code"</span><span class="plain-syntax">);    </span><span class="comment-syntax"> And this the second</span>
<span class="plain-syntax">    </span><a href="1-ls.html#SP19" class="function-link"><span class="function-syntax">LargeScale::package_type</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"_linkage"</span><span class="plain-syntax">); </span><span class="comment-syntax"> And this the third</span>

<span class="plain-syntax">    </span><a href="1-pck.html#SP12" class="function-link"><span class="function-syntax">Packaging::enter</span></a><span class="plain-syntax">(</span><a href="1-ls.html#SP4" class="function-link"><span class="function-syntax">LargeScale::main_request</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">)); </span><span class="comment-syntax"> Which we never exit</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP21" class="paragraph-anchor"></a><b>&#167;21. Convenient types.</b>This structure is used for text literals, which are two-word data structures.
The necessary typename is created on demand: this amounts to writing
<span class="extract"><span class="extract-syntax">typename text_literal struct int32 unchecked</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">inter_type</span><span class="plain-syntax"> </span><span class="function-syntax">LargeScale::text_literal_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">text_literal_s</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">text_literal_s</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">text_literal_s</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterPackage::from_URL</span><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"/main/generic"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"no main/generic"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_bookmark</span><span class="plain-syntax"> </span><span class="identifier-syntax">in_generic</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterBookmark::at_end_of_this_package</span><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">operands</span><span class="plain-syntax">[2];</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">operands</span><span class="plain-syntax">[0] = </span><span class="identifier-syntax">InterTypes::to_TID_at</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">in_generic</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterTypes::from_constructor_code</span><span class="plain-syntax">(</span><span class="identifier-syntax">INT32_ITCONC</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">operands</span><span class="plain-syntax">[1] = </span><span class="identifier-syntax">InterTypes::to_TID_at</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">in_generic</span><span class="plain-syntax">, </span><span class="identifier-syntax">InterTypes::unchecked</span><span class="plain-syntax">());</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">text_literal_s</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">InterSymbolsTable::create_with_unique_name</span><span class="plain-syntax">(</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">InterBookmark::scope</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">in_generic</span><span class="plain-syntax">), </span><span class="identifier-syntax">I</span><span class="string-syntax">"text_literal"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">TypenameInstruction::new</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">in_generic</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_literal_s</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">STRUCT_ITCONC</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">, </span><span class="identifier-syntax">operands</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">InterBookmark::baseline</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">in_generic</span><span class="plain-syntax">) + </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">site</span><span class="plain-syntax">.</span><span class="element-syntax">strdata</span><span class="plain-syntax">.</span><span class="element-syntax">text_literal_s</span><span class="plain-syntax"> = </span><span class="identifier-syntax">text_literal_s</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">InterTypes::from_type_name</span><span class="plain-syntax">(</span><span class="identifier-syntax">text_literal_s</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="1-bm.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresscurrentchapter">1</li><li class="progresssection"><a href="1-bm.html">bm</a></li><li class="progresscurrent">ls</li><li class="progresssection"><a href="1-ip.html">ip</a></li><li class="progresssection"><a href="1-org.html">org</a></li><li class="progresssection"><a href="1-hl.html">hl</a></li><li class="progresssection"><a href="1-lr.html">lr</a></li><li class="progresssection"><a href="1-trn.html">trn</a></li><li class="progresssection"><a href="1-pck.html">pck</a></li><li class="progresssection"><a href="1-in.html">in</a></li><li class="progresschapter"><a href="2-is.html">2</a></li><li class="progresschapter"><a href="3-prd.html">3</a></li><li class="progressnext"><a href="1-ip.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

